<?php
class erpapi_shop_matrix_shopex_bbc_response_aftersale extends erpapi_shop_response_aftersale {

    static public $return_type = array(
        'ONLY_REFUND'=>'refund',
        'REFUND_GOODS'=>'return',
        'EXCHANGING_GOODS'=>'change',
       
    );
    public function add($params){
        $sdf = parent::add($params);
        
        $table_additional = $this->_aftersale_additional($params);
        if($table_additional){
            $sdf['table_additional'] = $table_additional;
        }

       return $sdf;
    }

    public function _aftersale_additional($params){
  
        $shop_id   = $this->__channelObj->channel['shop_id'];

        if ($params['return_type']){
            $data = array(
                'shop_id'=>$shop_id,
                'return_bn'=>$params['return_bn'],
                'return_type'=>self::$return_type[$params['return_type']],
                'model'=>'return_product_bbc',
            );
            return $data;
            
        }
        
        
    }
}